<template>
  <!-- 面包屑组件 -->
  <div class="crum">
    <router-link to="/" class="home">首页</router-link>
    <!-- 箭头图标 -->
    <i class="icon">></i>
    <router-link v-if="parentPath" :to="parentPath">{{
      parentName
    }}</router-link>
    <span v-else class="parentName">{{ parentName }}</span>
    <slot></slot>
  </div>
</template>

<script setup lang="ts">
defineProps({
  parentName: {
    type: String,
    default: '',
  },
  parentPath: {
    type: String,
    default: '',
  },
});
</script>
<style scoped lang="less">
.home {
  font-size: 14px;
  color: #666;
}
.parentName {
  font-size: 14px;
  color: #3333;
}
</style>
